﻿#ifndef __REDIS_QUERY_RESULT_HEAD__
#define __REDIS_QUERY_RESULT_HEAD__


#include <cstdint>
#include <memory>

struct redisReplyData
{

};

struct redisReply;
//----------------------------------------------------------------------------------------
class  CRedisQueryResult
{
public:

	enum  EDataTypes
	{
		REPLY_STRING =1,
		REPLY_ARRAY =2,
		REPLY_INTEGER =3,
		REPLY_NIL =4,
		REPLY_STATUS =5,
		REPLY_ERROR =6
	};


	CRedisQueryResult(redisReply * pRedisR);

	virtual ~CRedisQueryResult() {}

	void			FreeReply();

	int				GetReplyType();

	char*			GetString();
	int64_t	        GetInt64();

	int				GetArrayLenth();



	redisReply*		GetRedisReply() {return m_pReply;}

	redisReply*		GetNextElement();

protected:

	redisReply*     m_pReply;
						
	int			    m_cur_element;
};
 

using RedisQueryResultSptr = std::shared_ptr<CRedisQueryResult>;
#endif